home *** CD-ROM | disk | FTP | other *** search
/ Ice Princess Press Kit / Ice Princess Press Kit.iso / pc / program.dxr / Internal_51_Roll +Nav Cur Sound.ls < prev    next >
Encoding:
Text File  |  2005-03-02  |  1.6 KB  |  58 lines

  1. property gowhere, soundMember, soundChannel, loops, pCursorChange, pCursorChoice, spriteNum, mySprite
  2.  
  3. on getBehaviorDescription me
  4.   return "Rollover,Sound, Marker & Cursor" & RETURN & RETURN & "Just place on Sprite and fill-in Properties"
  5. end
  6.  
  7. on getBehaviorTooltip me
  8.   return "Use with any sprite member."
  9. end
  10.  
  11. on getPropertyDescriptionList me
  12.   xlist = [:]
  13.   addProp(xlist, #gowhere, [#comment: "Navigate to which Frame Label?:", #format: #marker, #default: #bitmap])
  14.   addProp(xlist, #soundMember, [#comment: "Sound to play", #format: #sound, #default: VOID])
  15.   addProp(xlist, #soundChannel, [#comment: "Sound channel", #format: #integer, #default: 3, #range: [1, 2, 3, 4]])
  16.   addProp(xlist, #loops, [#comment: "How many loops:", #format: #integer, #default: 1, #range: [1, 2, 3]])
  17.   addProp(xlist, #pCursorChoice, [#default: 1, #format: #boolean, #comment: "Do you want a cursor change?"])
  18.   addProp(xlist, #pCursorChange, [#format: #cursor, #comment: "Cursor to change to", #default: 280])
  19.   return xlist
  20. end
  21.  
  22. on beginSprite me
  23.   mySprite = sprite(me.spriteNum)
  24. end
  25.  
  26. on changeCur
  27.   if pCursorChoice = 1 then
  28.     cursor(pCursorChange)
  29.   else
  30.     cursor(0)
  31.   end if
  32. end
  33.  
  34. on playMySound me
  35.   soundstatus = sound(soundChannel)
  36.   if soundstatus = 4 then
  37.     sound(soundChannel).play()
  38.   else
  39.     sound(soundChannel).play([#member: soundMember, #loopCount: loops])
  40.   end if
  41. end
  42.  
  43. on mouseUp me
  44.   playMySound()
  45.   go(gowhere)
  46.   cursor(0)
  47. end
  48.  
  49. on mouseEnter me
  50.   sprite(mySprite).memberNum = sprite(mySprite).memberNum + 1
  51.   changeCur()
  52. end
  53.  
  54. on mouseLeave me
  55.   cursor(0)
  56.   sprite(mySprite).memberNum = sprite(mySprite).memberNum - 1
  57. end
  58.